<template>

      <el-col :span="24" class="colmargin">
       
        <el-radio-group v-model="indextab" @change="getExecutionList" style="margin-bottom: 10px;">
    <el-radio-button size="small" label="1">办理入院</el-radio-button>
    <el-radio-button size="small" label="2">出院结算</el-radio-button>
    <el-radio-button size="small" label="3">出院结算撤销</el-radio-button>
 
  </el-radio-group>

         <el-col :span="24">
          <el-table
      :data="tableData"
      style="width: 100%"

      >

      <el-table-column
        prop="created_at"
        label="日期"
       >
      </el-table-column>
      <el-table-column
        prop="psn_no"
        label="人员编号"
       >
      </el-table-column>
      <el-table-column
        prop="infno"
        label="交易编号">
      </el-table-column>
        <el-table-column
        prop="msgid"
        label="ID"
       >
      </el-table-column>

              <el-table-column
        prop=""
        label="撤销"
       >
        <template slot-scope="scope">
    
         <el-button type="success" @click="qiut(scope.row)">撤销</el-button>
      </template>
      </el-table-column>
     
    </el-table>
      
     <el-pagination
  background
  small
  layout="prev, pager, next"
  :current-page='currentPage'
  :page-size='pageSize'
  :total="totalPage"
  @prev-click='prevPage'
    @next-click='nextPage'
    @current-change='sizeChange'
     v-if="currentPageData.length!=0"
  >
</el-pagination>
      </el-col>
         

<el-dialog :close-on-click-modal='false'
  title="提示"
  :visible.sync="centerDialogVisible"
  width="70%"
  center
  class="see_box"
  >

  <span slot="footer" class="dialog-footer">
  
    <el-button type="success" @click="centerDialogVisible = false">确 定</el-button>
  </span>
</el-dialog>

      </el-col>

</template>

<script>
import {
  getRighting,
  postRighting,

} from "@/api/zhuyanre";

export default {
  // name:"costsRecord",
    props: ["id"],
  data(){
    return {
      tableData:[
     
      ],
      indextab:'1',
      money:'',
      centerDialogVisible:false,
      item:{},
 //所有数据
              totalPage: 1, // 统共页数，默认为1
             currentPage: 1, //当前页数 ，默认为1
            pageSize: 4, // 每页显示数量
            currentPageData: [], //当前页显示内容
    cuntent:[]
    }
    
  },
   mounted(){
       
      this.getExecutionList()
    
   },
   methods:{
     //查看  详情

        getExecutionList() {
     let d = {
        limit:20,
        page:1,
        type:parseInt(this.indextab)
      };
    getRighting(d).then(res=>{
        this.tableData=res.data.lists
    })
   
    },
qiut(row){
     postRighting({id:row.id}).then(res=>{
        if (res.code==200) {
                     this.$message({
                  message: "提交成功",
                  type: "success"
                });
        }
    })
},
//上一页
prevPage() {
        console.log(this.currentPage);
        if (this.currentPage == 1) return;

        this.currentPage--;
        this.setCurrentPageData();

},
// 下一页
nextPage() {
        if (this.currentPage == this.totalPage)return ;

        this.currentPage++;
        this.setCurrentPageData();

        },
        sizeChange(val){
          console.log(val)
          this.currentPage=val
           this.setCurrentPageData();
        },
        handleSelectionChange(val){
          this.cuntent=val
        },

 }

 
 
}
</script>

<style scoped>
.colmargin{
  overflow: auto ;
    padding: 0 10px;
} 
.see_box .el-col{
  margin:5px 0px;
  font-size: 20px;
}
.see_box .span{
  color: dimgray;
  font-size: 18px;
  text-indent:2em;
}
 .span{
  color: dimgray;
  font-size: 13px;
  text-indent:2em;
}
.colmargin .el-col{
  margin:2px 0px;
}
</style>